package LeetCode.month02.day43;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;

public class No01 {
    public int[] twoSum(int[] nums, int target) {
        Map<Integer,Integer> map = new HashMap<>();
        int n = nums.length;
        for (int i = 0;; i++) {
            if(map.containsKey(target-nums[i])) return new int[]{i,map.get(target-nums[i])};
            else map.put(nums[i],i);
        }
    }
}
